Skip to content

Conversation

@mikebohdan
Copy link

I added the ability to pick a toolchain for rustfmt. This will allow nightly formatting rules while using a non-nightly toolchain.

@github-actions github-actions bot requested a review from stevearc March 14, 2025 00:12
options = {
-- The default edition of Rust to use when no Cargo.toml file is found
default_edition = "2021",
default_toolchain = "stable",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default_edition is only a default because it's what we use if there is no Cargo.toml file. Let's rename this to just toolchain.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And should add a short comment above to explain it as well

},
args = function(self, ctx)
local args = { "--emit=stdout" }
local toolchain = "+" .. self.options.default_toolchain
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link me to the documentation for passing +<toolchain> to rustfmt? I've seen this for cargo, but would like to read something about how it works for rustfmt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants